import { Drawer } from "antd";
import React from "react";
import { useState } from "react";

const DrawerTrigger = ({ width,title,trigger,children }:any) => {
  const [open, setOpen] = useState(false);
  return (
    <>
      <span onClick={()=>setOpen(true)}>{trigger}</span>
      <Drawer title={title} width={width||600} onClose={()=>setOpen(false)} open={open}>{children}</Drawer>
    </>
  );
};
export default DrawerTrigger;
